// import { cosh } from 'core-js/core/number'
import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  {
    path: '/',
    redirect: '/home' //默认路径
  },
  {
    path: '/sc',
    name: 'sc',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( /* webpackChunkName: "about" */ '../views/sc'),
    meta:{
      title:'一句诗词'
    }
  },
  {
    path: '/djt',
    name: 'djt',
    component: () => import('../views/djt'),
    meta:{
      title:'毒鸡汤'
    }
  },
  {
    path: '/sentens',
    name: 'sentens',
    component: () => import('../views/sentens'),
    meta:{
      title:'励志句子'
    }
  }
]

const router = new VueRouter({
  routes
})

// 
router.beforeEach((to,from,next)=>{
  window.document.title = to.meta.title
  console.log(to);
  next()
})

export default router